package cn.gson.springboot.model.pojos;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "outbound_detail", schema = "crm")
public class OutboundDetail {
    private int outboundDetailId;
    private String outboundDetailName;
    private Integer outboundDetailCount;
    private Integer outboundDetailInventory;
    private String outboundDetailNote;
    private Integer outboundDetailStatus;
    private Outbound outboundByOutboundId;

    @Id
    @Column(name = "outbound_detail_id", nullable = false)
    public int getOutboundDetailId() {
        return outboundDetailId;
    }

    public void setOutboundDetailId(int outboundDetailId) {
        this.outboundDetailId = outboundDetailId;
    }

    @Basic
    @Column(name = "outbound_detail_name", nullable = true, length = 255)
    public String getOutboundDetailName() {
        return outboundDetailName;
    }

    public void setOutboundDetailName(String outboundDetailName) {
        this.outboundDetailName = outboundDetailName;
    }

    @Basic
    @Column(name = "outbound_detail_count", nullable = true)
    public Integer getOutboundDetailCount() {
        return outboundDetailCount;
    }

    public void setOutboundDetailCount(Integer outboundDetailCount) {
        this.outboundDetailCount = outboundDetailCount;
    }

    @Basic
    @Column(name = "outbound_detail_inventory", nullable = true)
    public Integer getOutboundDetailInventory() {
        return outboundDetailInventory;
    }

    public void setOutboundDetailInventory(Integer outboundDetailInventory) {
        this.outboundDetailInventory = outboundDetailInventory;
    }

    @Basic
    @Column(name = "outbound_detail_note", nullable = true, length = 255)
    public String getOutboundDetailNote() {
        return outboundDetailNote;
    }

    public void setOutboundDetailNote(String outboundDetailNote) {
        this.outboundDetailNote = outboundDetailNote;
    }

    @Basic
    @Column(name = "outbound_detail_status", nullable = true)
    public Integer getOutboundDetailStatus() {
        return outboundDetailStatus;
    }

    public void setOutboundDetailStatus(Integer outboundDetailStatus) {
        this.outboundDetailStatus = outboundDetailStatus;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OutboundDetail that = (OutboundDetail) o;
        return outboundDetailId == that.outboundDetailId &&
                Objects.equals(outboundDetailName, that.outboundDetailName) &&
                Objects.equals(outboundDetailCount, that.outboundDetailCount) &&
                Objects.equals(outboundDetailInventory, that.outboundDetailInventory) &&
                Objects.equals(outboundDetailNote, that.outboundDetailNote) &&
                Objects.equals(outboundDetailStatus, that.outboundDetailStatus);
    }

    @Override
    public int hashCode() {
        return Objects.hash(outboundDetailId, outboundDetailName, outboundDetailCount, outboundDetailInventory, outboundDetailNote, outboundDetailStatus);
    }

    @ManyToOne
    @JoinColumn(name = "outbound_id", referencedColumnName = "outbound_id")
    public Outbound getOutboundByOutboundId() {
        return outboundByOutboundId;
    }

    public void setOutboundByOutboundId(Outbound outboundByOutboundId) {
        this.outboundByOutboundId = outboundByOutboundId;
    }


}
